package com.wlc.base.design.proxy;

/**
 * @author 王立朝 wanglichao@champion-credit.com
 * @description UserDao代理模式
 * @date 2021-09-16 23:53
 */
public class UserDaoProxy extends UserDao {

    private UserDao userDao;

    public UserDaoProxy() {
        if (userDao == null) {
            userDao = new UserDao();
        }
    }

    @Override
    public void save() {
        System.out.println("开启事务...");
        userDao.save();
        System.out.println("关闭事务...");
    }
}
